<style >
    #tableBizModelForOBJEditor + .layui-table-view .layui-table-body tbody > tr > td {
        padding: 0;
    }

    #tableBizModelForOBJEditor + .layui-table-view .layui-table-body tbody > tr > td > .layui-table-cell {
        height: 60px;
        line-height: 60px;
    }
    
    #tableBizModelFor3DTILESEditor + .layui-table-view .layui-table-body tbody > tr > td {
        padding: 0;
    }

    #tableBizModelFor3DTILESEditor + .layui-table-view .layui-table-body tbody > tr > td > .layui-table-cell {
        height: 60px;
        line-height: 60px;
    }
    .tableBizModelForOBJEditorImg {
        width: 60px;
        height:60px;
        max-width: none;
        cursor: pointer;
    }

    .layui-table-view {
        margin: 0;
    }
    .layui-table-cell {
	    padding: 0px;
	}
</style>
<!-- 正文开始 -->
<div class="layui-fluid" style="padding: 0px;">
    <div class="layui-card">
        <div class="layui-card-body table-tool-mini" >
            <div class="layui-form toolbar">
                <div class="layui-form-item">
                    <div class="layui-inline">
                        <div class="layui-input-inline mr0">
                            <input name="name" class="layui-input" type="text" placeholder="输入名称"/>
                        </div>
                    </div>
                    <div class="layui-inline">
                        <button class="layui-btn icon-btn" lay-filter="formSubSearchModelForOBJ" lay-submit>
                            <i class="layui-icon">&#xe615;</i>搜索
                        </button>
                    </div>
                </div>
            </div>        
			<table class="layui-table" id="tableBizModelForOBJEditor" lay-filter="tableBizModelForOBJEditor"></table>
		</div>
	</div>
</div>

<!-- 表格操作列 -->
<script type="text/html" id="tableBarBizModel">
    <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="edit">编辑</a>
    <a class="layui-btn layui-btn-danger layui-btn-xs" lay-event="del">删除</a>
</script>
<!-- 表格状态列 -->
<script type="text/html" id="tableStateBizModel">
#[[  {{#  if(d.enabled === '1'){ }}
    <span style="color: #23aa2e;">正常</span>
  {{#  } else { }}
	<span style="color: #ff0000;">禁止</span>
  {{#  } }}
]]#
</script>




<!-- js部分 -->
<script>
    layui.use(['layer', 'form', 'table', 'util', 'admin', 'config','colorpicker'], function () {
        var $ = layui.jquery;
        var layer = layui.layer;
        var form = layui.form;
        var table = layui.table;
        var util = layui.util;
        var admin = layui.admin;
        var config = layui.config;
        var colorpicker = layui.colorpicker;
        
        var bizModelForObjEditorTb = table.render({
            elem: '#tableBizModelForOBJEditor',
            url: '#(ctx)/biz/model/listData', 
            toolbar: false,
            cellMinWidth: 100,
            page: {
                layout: ['prev', 'page', 'next','count'] //自定义分页布局
                //,curr: 5 //设定初始在第 5 页
                ,groups:5 //只显示 1 个连续页码
                ,first: false //不显示首页
                ,last: false //不显示尾页
            },
            where:{
            	type:'OBJ',
            	sceneId:'#(sceneId)',
            },
            cols: [[
                {
                    align: 'center', templet: function (d) {
                    	if(d.img)
                        	return '<img src="' + d.img + '"  class="tableBizModelForOBJEditorImg" />';
                        else
                        	return '';
                    }, title: '缩略图', width: 60, unresize: true
                },
                {field: 'name', sort: false, title: '名称', align: 'center'},
            ]],
            done: function (res, curr, count) {
            }
        });
        form.on('submit(formSubSearchModelForOBJ)', function (data) {
        	bizModelForObjEditorTb.reload({where: data.field}, 'data');
        });
      //监听行单击事件
        table.on('row(tableBizModelForOBJEditor)', function(obj){
          	obj.tr.addClass('layui-table-click').siblings().removeClass('layui-table-click');
          	editMarker.destroyForDrawModel();
          	editMarker.drawForModel(obj.data,function(e){
          		obj.tr.siblings().removeClass('layui-table-click');
          	});
        });
    });
    
</script>
